Day 15 - Regular expressions - Anchors

50

Exercise 15.02

Count how many empty lines are contained in the file examples.txt

Go to solution

Anchoring text is very important as many times the pattern we are looking for is repeated in other

parts of the line, but those are not interesting. The beginning and the end of the line are good

reference points to start analysing text, so it is good that regular expressions provide this two special

positioning characters.

In the next lesson we will discuss multiple matches, but for the time being be happy, your knowledge

of regular expressions is increasing day by day!

Suggested film for the evening: Jason and the Argonauts (1963) - When is comes to use anchors

mister Jason is the system administrator you need; he also knows a lot about escaping.